<?php
  require_once('tpl/header.php');
?>

   <?php 
	// mysql_connect("localhost","root","");
	// mysql_select_db("neuvideo");
	// mysql_set_charset("utf8");
	require("inc_admin.php");
	connect();
	$sql="select * from videotype";
	$result=mysql_query($sql);//结果集

	 ?>
	 <table class="table table-hover" width="60%">
	 	<a href="typeAdd.php">添加视频类别</a>
		<caption>视频类型列表</caption>
			<tr>
				<td width=15%>序号</td>
				<td width=15%>类别名称</td>
				<td width=15%>操作</td>
			</tr>

			<?php
		while ($row=mysql_fetch_assoc($result)) 
		{
			?>
			<tr>
				<th><?php echo $row["tid"]; ?></th>
				<th><?php echo $row["typename"]; ?></th>
				<th><a href="typeEdit.php ?tid=<?php echo $row["tid"]; ?>">修改</a>|
					<a href="doTypeDelete.php ?tid=<?php echo $row["tid"]; ?>" onclick="return confirm('确认删除吗？')">删除</a></th>
			</tr>
		<?php 

		}
				//$row是一个关联数组，下标分别是数据库中的各字段名
				// $row=mysql_fetch_assoc($result);//从结果集只能中取得一条记录
				// var_dump($row);
		?>
	</table>


<?php
  require_once('tpl/footer.php');
?>